import React, { useState } from "react";
import { ProductCard, Empty } from "react-vant";

const Index: React.FC = () => {
  const [gw, setGw] = useState(JSON.parse(localStorage.getItem("car")!));
  return (
    <div>
      {gw ? (
        gw.map((v: any, i: any) => (
          <div key={i}>
            <ProductCard
              price={v.price}
              desc={v.word}
              title={v.title}
              thumb={v.img}
            />
          </div>
        ))
      ) : (
        <Empty description="购物车为空" />
      )}
    </div>
  );
};

export default Index;